package com.wryyyyy.mapper;

import com.wryyyyy.dto.AddMaterialDTO;
import com.wryyyyy.entity.DishMaterial;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wryyyyy.entity.Material;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author wryyyyy
 * @since 2023-11-12
 */
public interface DishMaterialMapper extends BaseMapper<DishMaterial> {
    Integer insertBatch(@Param("dishId") String dishId, @Param("materials") List<AddMaterialDTO> materials);

    @Select("select * from tb_dish_material where dish_id = #{dishId}")
    List<DishMaterial> selectByDish(@Param("dishId") String dishId);
}
